import request from '@/utils/request'

// login
export const login = function (data) {
  return request.post('/user/login', data)
}

// register
export const register = function (data) {
  return request.post('/user/registered', data)
}

export const userInfo = function () {
  return request.get('/user')
}

// 获取收藏列表
export const getCollectList = function () {
  return request.get('/user/favorites')
}

// 添加收藏
export const addCollect = function (id) {
  return request.post('/user/favorites/' + id)
}

// 删除收藏
export const delCollect = function (id) {
  return request.delete('/user/favorites/' + id)
}

// 查看已发布房源列表
export const pushHouseList = function () {
  return request.get('/user/houses')
}
